using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._DataManagementTools._General
{
    /// <summary>
    /// <para>Merge</para>
    /// <para>Combines multiple input datasets into a single, new output dataset. This tool can combine point, line, or polygon feature classes or tables.</para>
    /// <para>将多个输入数据集合并到一个新的输出数据集中。此工具可以组合点、线或面要素类或表。</para>
    /// </summary>    
    [DisplayName("Merge")]
    public class Merge : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public Merge()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_inputs">
        /// <para>Input Datasets</para>
        /// <para><xdoc>
        ///   <para>The input datasets that will be merged into a new output dataset. Input datasets can be point, line, or polygon feature classes or tables. Input feature classes must all be of the same geometry type.</para>
        ///   <para>Tables and feature classes can be combined in a single output dataset. The output type is determined by the first input. If the first input is a feature class, the output will be a feature class; if the first input is a table, the output will be a table. If a table is merged into a feature class, the rows from the input table will have null geometry.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>将合并到新输出数据集中的输入数据集。输入数据集可以是点、线或面要素类或表。输入要素类必须全部具有相同的几何类型。</para>
        ///   <para>表和要素类可以组合在单个输出数据集中。输出类型由第一个输入决定。如果第一个输入是要素类，则输出将为要素类;如果第一个输入是表，则输出将是表。如果将表合并到要素类中，则输入表中的行将具有空几何。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_output">
        /// <para>Output Dataset</para>
        /// <para>The output dataset that will contain all combined input datasets.</para>
        /// <para>将包含所有组合输入数据集的输出数据集。</para>
        /// </param>
        public Merge(List<object> _inputs, object _output)
        {
            this._inputs = _inputs;
            this._output = _output;
        }
        public override string ToolboxName => "Data Management Tools";

        public override string ToolName => "Merge";

        public override string CallName => "management.Merge";

        public override List<string> AcceptEnvironments => ["MDomain", "MResolution", "MTolerance", "XYDomain", "XYResolution", "XYTolerance", "ZDomain", "ZResolution", "ZTolerance", "extent", "geographicTransformations", "maintainAttachments", "outputCoordinateSystem", "outputMFlag", "outputZFlag", "outputZValue", "scratchWorkspace", "transferGDBAttributeProperties", "workspace"];

        public override object[] ParameterInfo => [_inputs, _output, _field_mappings, _add_source.GetGPValue()];

        /// <summary>
        /// <para>Input Datasets</para>
        /// <para><xdoc>
        ///   <para>The input datasets that will be merged into a new output dataset. Input datasets can be point, line, or polygon feature classes or tables. Input feature classes must all be of the same geometry type.</para>
        ///   <para>Tables and feature classes can be combined in a single output dataset. The output type is determined by the first input. If the first input is a feature class, the output will be a feature class; if the first input is a table, the output will be a table. If a table is merged into a feature class, the rows from the input table will have null geometry.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>将合并到新输出数据集中的输入数据集。输入数据集可以是点、线或面要素类或表。输入要素类必须全部具有相同的几何类型。</para>
        ///   <para>表和要素类可以组合在单个输出数据集中。输出类型由第一个输入决定。如果第一个输入是要素类，则输出将为要素类;如果第一个输入是表，则输出将是表。如果将表合并到要素类中，则输入表中的行将具有空几何。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Datasets")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public List<object> _inputs { get; set; }


        /// <summary>
        /// <para>Output Dataset</para>
        /// <para>The output dataset that will contain all combined input datasets.</para>
        /// <para>将包含所有组合输入数据集的输出数据集。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Dataset")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _output { get; set; }


        /// <summary>
        /// <para>Field Map</para>
        /// <para><xdoc>
        ///   <para>Controls which attribute fields will be in the output. By default, all fields from the inputs will be included.</para>
        ///   <para>Fields can be added, deleted, renamed, and reordered, and you can change their properties.</para>
        ///   <para>Merge rules allow you to specify how values from two or more input fields are merged or combined into a single output value. There are several merge rules you can use to determine how the output field will be populated with values.
        ///   <bulletList>
        ///     <bullet_item>First—Use the input fields' first value.  </bullet_item><para/>
        ///     <bullet_item>Last—Use the input fields' last value.  </bullet_item><para/>
        ///     <bullet_item>Join—Concatenate (join) the input field values.  </bullet_item><para/>
        ///     <bullet_item>Sum—Calculate the total of the input field values.  </bullet_item><para/>
        ///     <bullet_item>Mean—Calculate the mean (average) of the input field values.  </bullet_item><para/>
        ///     <bullet_item>Median—Calculate the median (middle) of the input field values.  </bullet_item><para/>
        ///     <bullet_item>Mode—Use the value with the highest frequency.  </bullet_item><para/>
        ///     <bullet_item>Min—Use the minimum value of all the input field values.  </bullet_item><para/>
        ///     <bullet_item>Max—Use the maximum value of all the input field values.  </bullet_item><para/>
        ///     <bullet_item>Standard deviation—Use the standard deviation classification method on all the input field values.  </bullet_item><para/>
        ///     <bullet_item>Count—Find the number of records included in the calculation.  </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>控制输出中将包含哪些属性字段。默认情况下，将包含输入中的所有字段。</para>
        ///   <para>可以添加、删除、重命名和重新排序字段，并且可以更改其属性。</para>
        /// <para>合并规则允许您指定如何将两个或多个输入字段中的值合并或组合为单个输出值。您可以使用多个合并规则来确定如何使用值填充输出字段。
        ///   <bulletList>
        ///     <bullet_item>第一 - 使用输入字段的第一个值。</bullet_item><para/>
        ///     <bullet_item>最后 （Last） - 使用输入字段的最后一个值。</bullet_item><para/>
        ///     <bullet_item>连接 （Join） - 连接（连接）输入字段值。</bullet_item><para/>
        ///     <bullet_item>求和 （Sum） - 计算输入字段值的总和。</bullet_item><para/>
        ///     <bullet_item>均值 （Mean） - 计算输入字段值的平均值（平均值）。</bullet_item><para/>
        ///     <bullet_item>中位数 - 计算输入字段值的中位数（中间值）。</bullet_item><para/>
        ///     <bullet_item>模式 （Mode） - 使用频率最高的值。</bullet_item><para/>
        ///     <bullet_item>最小值 （Min） - 使用所有输入字段值的最小值。</bullet_item><para/>
        ///     <bullet_item>最大值 （Max） - 使用所有输入字段值的最大值。</bullet_item><para/>
        ///     <bullet_item>标准差 - 对所有输入字段值使用标准差分类方法。</bullet_item><para/>
        ///     <bullet_item>计数 （Count） - 查找计算中包含的记录数。</bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Field Map")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _field_mappings { get; set; } = null;


        /// <summary>
        /// <para>Add source information to output</para>
        /// <para><xdoc>
        ///   <para>Specifies whether source information will be added to the output dataset in a new text field, MERGE_SRC. The values in the MERGE_SRC field will indicate the input dataset path or layer name that is the source of each record in the output.</para>
        ///   <bulletList>
        ///     <bullet_item>Unchecked—Source information will not be added to the output dataset in a MERGE_SRC field. This is the default.</bullet_item><para/>
        ///     <bullet_item>Checked—Source information will be added to the output dataset in a MERGE_SRC field.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是否将源信息添加到新文本字段中的输出数据集中，MERGE_SRC。MERGE_SRC字段中的值将指示输入数据集路径或图层名称，该路径或图层名称是输出中每条记录的来源。</para>
        ///   <bulletList>
        ///     <bullet_item>未选中 - 源信息不会添加到MERGE_SRC字段的输出数据集中。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>选中 - 源信息将添加到MERGE_SRC字段的输出数据集中。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Add source information to output")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _add_source_value _add_source { get; set; } = _add_source_value._false;

        public enum _add_source_value
        {
            /// <summary>
            /// <para>ADD_SOURCE_INFO</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("ADD_SOURCE_INFO")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_SOURCE_INFO</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_SOURCE_INFO")]
            [GPEnumValue("false")]
            _false,

        }

        public Merge SetEnv(object MDomain = null, object MResolution = null, object MTolerance = null, object XYDomain = null, object XYResolution = null, object XYTolerance = null, object ZDomain = null, object ZResolution = null, object ZTolerance = null, object extent = null, object geographicTransformations = null, object outputCoordinateSystem = null, object outputMFlag = null, object outputZFlag = null, object outputZValue = null, object scratchWorkspace = null, object workspace = null)
        {
            base.SetEnv(MDomain: MDomain, MResolution: MResolution, MTolerance: MTolerance, XYDomain: XYDomain, XYResolution: XYResolution, XYTolerance: XYTolerance, ZDomain: ZDomain, ZResolution: ZResolution, ZTolerance: ZTolerance, extent: extent, geographicTransformations: geographicTransformations, outputCoordinateSystem: outputCoordinateSystem, outputMFlag: outputMFlag, outputZFlag: outputZFlag, outputZValue: outputZValue, scratchWorkspace: scratchWorkspace, workspace: workspace);
            return this;
        }

    }

}